﻿using System.Collections.Generic;
using System.Linq;
using Medianamik.Core;
using Medianamik.Core.DAL.Repositories;
using Medianamik.UI.Web.ModalWindows.ContentManagement;
using StructureMap;

namespace Medianamik.UI.Web.Shop
{
    public partial class ShippingTypeSelector : TypeSelectorWindow
    {
        private readonly INodeTypeRepository _nodeTypeRepository = ObjectFactory
            .GetInstance<INodeTypeRepository>();

        protected override IList<NodeType> GetLegitimateChildTypes()
        {
            return _nodeTypeRepository.ChildsOf(TypeIds.ShippingBase, false, 1, false)
                .OrderBy(t => t.LocalizedName)
                .ToList();
        }
    }
}
